<?php
if (! defined ( ____DataClass_t0_t1_php____ )) {
	define ( '____DataClass_t0_t1_php____', true );
	
	require __PROJECT_ROOT . "/configs/Mysql.class.php";
	
	//include_once "Pageinfo.php";
	

	if (! defined ( '_TAX_RATES_TABLE_NAME' )) {
		
		define ( '_TAX_RATES_TABLE_NAME', 'tax_rates' );
	}
	
	if (! defined ( '_WHOS_ONLINE_TABLE_NAME' )) {
		
		define ( '_WHOS_ONLINE_TABLE_NAME', 'whos_online' );
	}
	
	//DataClass_t0_t1.php
	

	class DataClass_t0_t1 {
		
		public $t0_tax_rates_id;
		public $t0_tax_zone_id;
		public $t0_tax_class_id;
		public $t0_tax_priority;
		public $t0_tax_rate;
		public $t0_tax_description;
		public $t0_last_modified;
		public $t0_date_added;
		public $t1_customer_id;
		public $t1_full_name;
		public $t1_session_id;
		public $t1_ip_address;
		public $t1_time_entry;
		public $t1_time_last_click;
		public $t1_last_page_url;
		
		private $in_dbObject;
		private $ex_dbObject;
		
		function __construct() {
			
			$this->in_dbObject = null;
			$this->ex_dbObject = null;
		
		}
		
		function __destruct() {
			if ($this->in_dbObject != null) {
				$this->in_dbObject->close ();
				$this->in_dbObject = null;
			}
		
		}
		
		function LinkDB() {
			if ($this->in_dbObject != null) {
				$this->in_dbObject->close ();
			}
			$this->in_dbObject = new DB ( );
		}
		
		private function GetDB() {
			if ($this->ex_dbObject != null) {
				return $this->ex_dbObject;
			}
			if ($this->in_dbObject != null) {
				return $this->in_dbObject;
			} else {
				return new DB ( );
			}
		}
		
		private function FreeDB(&$db) {
			if ($this->ex_dbObject == null && $this->in_dbObject == null) {
				$db->close ();
				$db = null;
			}
		}
		
		public function GetInDB() {
			return $this->in_dbObject;
		}
		
		public function SetExDB($db) {
			$this->ex_dbObject = $db;
		}
		
		private function escape_string($sqlS123) {
			return mysql_real_escape_string ( $sqlS123 );
		}
		
		function Load($para_equal_t0_tax_rates_id) {
			
			$_dbObject = $this->GetDB ();
			
			$whereStr = "where 1=1 ";
			
			if ($para_equal_t0_tax_rates_id != null && $para_equal_t0_tax_rates_id != "") {
				$whereStr .= " and " . "" . "=" . "" . $para_equal_t0_tax_rates_id . "";
			}
			
			$sql = "select t0_tax_rates_id , t0_tax_zone_id , t0_tax_class_id , t0_tax_priority , t0_tax_rate , t0_tax_description , t0_last_modified , t0_date_added , t1_customer_id , t1_full_name , t1_session_id , t1_ip_address , t1_time_entry , t1_time_last_click , t1_last_page_url from " . _TAX_RATES_TABLE_NAME . " t0 join " . _WHOS_ONLINE_TABLE_NAME . " t1 on id=id " . $whereStr;
			
			//echo $sql."<br //>";
			

			$query = $_dbObject->query ( $sql );
			
			$row = $_dbObject->fetch_array ( $query );
			
			$re = 0;
			
			if ($row) {
				//$this->ConverOneRowValueToObj($row,$this);
				

				$this->t0_tax_rates_id = $row ['t0_tax_rates_id'];
				$this->t0_tax_zone_id = $row ['t0_tax_zone_id'];
				$this->t0_tax_class_id = $row ['t0_tax_class_id'];
				$this->t0_tax_priority = $row ['t0_tax_priority'];
				$this->t0_tax_rate = $row ['t0_tax_rate'];
				$this->t0_tax_description = $row ['t0_tax_description'];
				$this->t0_last_modified = $row ['t0_last_modified'];
				$this->t0_date_added = $row ['t0_date_added'];
				$this->t1_customer_id = $row ['t1_customer_id'];
				$this->t1_full_name = $row ['t1_full_name'];
				$this->t1_session_id = $row ['t1_session_id'];
				$this->t1_ip_address = $row ['t1_ip_address'];
				$this->t1_time_entry = $row ['t1_time_entry'];
				$this->t1_time_last_click = $row ['t1_time_last_click'];
				$this->t1_last_page_url = $row ['t1_last_page_url'];
				
				$re = 1;
			}
			
			$_dbObject->free_result ( $query );
			
			$this->FreeDB ( $_dbObject );
			return $re;
		}
		
	///////////////////////////////////////////////// end class /////////////////////////////
	

	}

}
?>

